FROM node:lts-slim
WORKDIR /app
COPY package*.json ./
RUN apt-get update
RUN apt-get install -y --no-install-recommends cron
RUN npm install --only=production && npm install pm2 -g
COPY . ./
RUN crontab task.txt
ENTRYPOINT ["sh", "start.sh"]